/**
 * There are <a href="https://www.hdzhx.com">邯郸智讯</a> code generation
 */
package com.boxin.ims.modules.wechat.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.BaseEntity;
import com.thinkgem.jeesite.modules.sys.entity.User;

/**
 * 微信特殊服务配置类Entity
 * @author Jakemanse
 * @version 2013-09-27
 */
@Entity
@Table(name = "wp_business_config")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class BusinessConfig extends BaseEntity {
	
	private final static String DEFAULT_PACKAGE = "com.boxin.ims.modules.wechat.busi";
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 编号
	private String name; 	// 名称
	private String keywords;	//关键词
	private String packageName;	//包名
	private String className;	//实现类
	private String beanId;		//Spring实例名
	
	private Integer ruleType;	//匹配类型	
	
	private String url;			//导航的URL
	private Boolean beMember;	//是否需要验证  是否会员
	
	private Date createTime;	// 创建日期
	private String delFlag;	// 删除标记（0：正常；1：删除）
	private String remarks; // 备注

	public BusinessConfig() {
		this.createTime = new Date();
		this.delFlag = DEL_FLAG_NORMAL;
		this.ruleType = 0;
	}

	public BusinessConfig(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_wechat_businessConfig")
	//@SequenceGenerator(name = "seq_wechat_businessConfig", sequenceName = "seq_wechat_businessConfig")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	
	@Length(min=1, max=200)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Length(min=0, max=255)
	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	
	@NotNull
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Length(min=1, max=1)
	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}

	public String getPackageName() {
		return packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	public String getBeanId() {
		return beanId;
	}

	public void setBeanId(String beanId) {
		this.beanId = beanId;
	}

	public Integer getRuleType() {
		if(ruleType==null) ruleType=0;
		return ruleType;
	}

	public void setRuleType(Integer ruleType) {
		this.ruleType = ruleType;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Boolean getBeMember() {
		return beMember;
	}

	public void setBeMember(Boolean beMember) {
		this.beMember = beMember;
	}

	 

	@Transient
	public boolean isNeedBeMember(){
		return (beMember!=null)  && beMember;
	}
	
	
	
	
}


